package com.example.qqemailtest.service.impl;

import com.example.qqemailtest.bean.User;
import com.example.qqemailtest.listener.RegisteryListenerEvent;
import com.example.qqemailtest.service.GetCodeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class GetCodeServiceImpl implements GetCodeService {
    @Autowired
    ApplicationEventPublisher applicationEventPublisher;
    @Override
    public void getCode(User user) {
       log.info("开始注册用户 ----RegistryServiceImpl" +user);
       applicationEventPublisher.publishEvent(new RegisteryListenerEvent(this,user));

    }
}
